Shape Maps
The plugin currently supports US maps and state names. The model and data styles for the subsequent examples are:
explore: airports is table('malloy-data.faa.airports'){ primary_key: code measure: airport_count is count(*) query: by_state is { where: state != null group_by: state aggregate: airport_count } }
Data Styles
{ "by_state": { "renderer": "shape_map" } }
Run as a simple query
query: airports->{nest: by_state}
| by_state |
|---|
Run as a trellis
By calling the configured map as a nested subtable, a trellis is formed.
query: airports->{ group_by: faa_region aggregate: airport_count nest: by_state }
| faa_region | airport_count | by_state |
|---|---|---|
| AGL | 4,437 | |
| ASW | 3,268 | |
| ASO | 2,924 | |
| AEA | 2,586 | |
| ANM | 2,102 |
Run as a trellis, repeated with different filters
query: airports->{ group_by: faa_region aggregate: airport_count nest: [ heliports is by_state {where: fac_type = 'HELIPORT'} seaplane_bases is by_state {where: fac_type = 'SEAPLANE BASE'} ] }
| faa_region | airport_count | heliports | seaplane_bases |
|---|---|---|---|
| AGL | 4,437 | ||
| ASW | 3,268 | ||
| ASO | 2,924 | ||
| AEA | 2,586 | ||
| ANM | 2,102 |
Malloy